package org.example.com.kotlinlab.delegate.class_delegate.demo01

interface Base {
    fun print()
}

class BaseImpl(val x: Int) : Base {
    override fun print() {
        print(x)
    }
}

/**
 * 代理类
 */
class Derived(val b: Base) : Base by b

fun main() {
    val b = BaseImpl(5)
    Derived(b).print()
}